<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>this-1</title>
</head>
<body>
this-1
</body>
<script>
    var x = 1;
    console.log("this", this);
    function test() {
        console.log("this.x:" + this.x);
        this.x = 2;
        console.log("this.x:" + this.x);
    }
    test(); // 1
    console.log("this.x:" + this.x);
</script>
</html>